﻿package core.ui.controls
{
    import core.event.*;
    import flash.display.*;
    import flash.events.*;

    public class Markbox extends Sprite
    {
        var nr:int;
        var um:Sprite;
        var dm:Sprite;
        public var marked:Boolean = false;

        public function Markbox(param1:int)
        {
            this.nr = param1;
            this.um = new Sprite();
            this.dm = new Sprite();
            this.um.graphics.beginFill(9474192);
            this.um.graphics.drawRect(0, 0, 22, 22);
            this.um.graphics.beginFill(14540253);
            this.um.graphics.drawRect(1, 1, 20, 20);
            this.um.graphics.endFill();
            this.dm.graphics.beginFill(1397662);
            this.dm.graphics.drawRect(0, 0, 22, 22);
            this.dm.graphics.beginFill(6922467);
            this.dm.graphics.drawRect(1, 1, 20, 20);
            this.dm.graphics.endFill();
            this.dm.visible = false;
            addChild(this.um);
            addChild(this.dm);
            this.addEventListener(MouseEvent.MOUSE_DOWN, this.MouseDown);
            return;
        }// end function

        private function MouseDown(event:MouseEvent) : void
        {
            dispatchEvent(new NumberEvent(this.nr));
            return;
        }// end function

        public function Mark() : void
        {
            this.um.visible = false;
            this.dm.visible = true;
            return;
        }// end function

        public function Unmark() : void
        {
            this.um.visible = true;
            this.dm.visible = false;
            return;
        }// end function

    }
}
